package com.j2some;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.alibaba.fastjson.JSON;
import com.yinquan.util.ObjectConvert;
import com.yishun.springboot.Application;
import com.yishun.springboot.mapper.RecordNumMapper;
import com.yishun.springboot.pojo.GeneralRecordNumBeans;
import com.yishun.springboot.service.GongWuSuTimedUploadTspService;


@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class Principal_SeMybatisTestRecord {

	@Autowired
	RecordNumMapper recordNumMapper;
	
	@Autowired
	GongWuSuTimedUploadTspService tspService;
    //查询对应tsp设备的最近一条数据记录  √
	@Test
    public void Record() {
//		int a = recordNumMapper.findSomeByconditions(0);
//		log.info("a:"+a);
		ObjectConvert o = new ObjectConvert();
		//查询本周上传条数汇总单元测试通过
		List<GeneralRecordNumBeans> l = tspService.findWeekToeveryDay();
		List<GeneralRecordNumBeans> l2 = tspService.weekURecord();
		int What_day_is_it_today=0;
		int Record_num=0;
		String Record_data="";
		
		int uploadRecord_num=0;
		
		//获取的数据日期
		List getparamListData = new ArrayList();
		//获取的记录条数
		List getparamListRecordNum = new ArrayList();
		
		//获取的记录条数
		List uploadparamListRecordNum = new ArrayList();
		for (int i = 0; i < l.size(); i++) {
//			What_day_is_it_today = l.get(i).getWhat_day_is_it_today();  //周几目前不需要、这是保留的
			Record_num = l.get(i).getRecord_num();
			Record_data = l.get(i).getRecord_data();
			getparamListData.add(Record_data);
			getparamListRecordNum.add(Record_num);
		}
		
		for (int i = 0; i < l.size(); i++) {
			uploadRecord_num = l2.get(i).getRecord_num();
			uploadparamListRecordNum.add(Record_num);
		}
    
	}	
}
